<?php session_start();?>

<?php if(isset($_SESSION['user'])){ ?> 
<html>
<head>
<title>Schedule Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {
	font-family: Cambria;
	color: #000080;
}
.style2 {color: #000099}
.style4 {font-size: 18px; font-weight: bold; }
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (Untitled-1) -->
<table width="620" height="592" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
	<tr>
	  <td height="317">
	   <?php 
			include'../logic/Classes/db.php'; 
			include'../logic/Classes/reportHandler.php';                                    
			
			$grade=$_GET['grade'];
			$x=new DbConnect();
            $con=$x->getConnection();
			
			$rep=new ReportHandler();
			$rep->setCon($con);
			
			$result=$rep->getGradeSchedule($grade);
			$time_now=mktime(date('H')+5,date('i')+30,date('s'),date('m'),date('d'),date('Y'));
			$num=mysql_num_rows($result);
			
			$income=0;
			$tot=0;
            
		?>
	  <table width="620" height="204" border="0" background="bit project/Page/report/images/report_01.png">
          <tr >
            <td><div align="center">
              <h1 class="style1">NAWODAYA INSTITUTE (PVT) LTD </h1>
            </div></td>
          </tr>
          <tr height="10%">
            <td bgcolor="#FFFFFF"> <div align="center" class="style2">No: 66/12, <br>Yatiyanthota road,<br>Awissawella. </div></td>
          </tr>
          <tr>
            <td><div align="center" class="style2">Tel : 036-2230454/Fax : 94-3-2687014<br>Email : avinavodaya@gmail.com</div></td>
          </tr>
		  
		  <tr>
		    <td background="images/report_04.png" style="background-repeat:no-repeat">&nbsp;</td>
		  </tr>
          <tr>
            <td height="3" style="background-repeat:no-repeat">&nbsp;</td>
          </tr>
        </table>
		
		  <table width="620" height="56" border="0">
            <tr>
              <td height="29" colspan="5" ><h3 align="center">Schedule Report </h3></td>
            </tr>
            <tr >
              <td width="159">&nbsp;</td>
              <td width="53"><strong>Grade : </strong></td>
              <td width="137"><?php echo $grade ;  ?></td>
              <td width="47"><strong>Year : </strong></td>
              <td width="202"><?php echo date('Y') ;  ?></td>
            </tr>
            <tr >
              <td colspan="5">&nbsp;</td>
            </tr>
          </table></td>
	</tr>
	<tr>
		<td bordercolor="#F0F0F0">
		<?php 
			
			if(!($num==0)) {?>
	  
	  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr bgcolor="#999999">
          <td width="174" bgcolor="#FFFFFF" class="style1"><div align="center" class="style4">Subject</div></td>
          <td width="82" bgcolor="#FFFFFF" class="style1"><div align="center" class="style4">Start</div></td>
          <td width="74" bgcolor="#FFFFFF" class="style1"><div align="center" class="style4">Day</div></td>
          <td width="74" bgcolor="#FFFFFF" class="style1"><div align="center" class="style4">End</div></td>
          <td width="88" bgcolor="#FFFFFF" class="style1"><div align="center" class="style4">Fee</div></td>
        </tr>
		   <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
		<?php while($row=mysql_fetch_array($result)) { ?>
        <tr>
          <td height="25"><div align="center"><?php echo $row['subject'];?></div></td>
          <td><div align="center"><?php echo $row['start'];?></div></td>
          <td><div align="center"><?php echo $row['days'];?></div></td>
          <td><div align="center"><?php echo $row['end'];?></div></td>
          
          <td><div align="center"><?php echo $row['c_fee'];?></div></td>
        </tr>
		<?php } ?> 
      </table>
	  
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>

	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <table width="619" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="173"background="images/Untitled-1.jpg"style="background-repeat:no-repeat" >&nbsp;&nbsp;&nbsp;<?php echo $_SESSION['user']; ?></td>
          <td width="184">&nbsp;</td>
          <td width="147">&nbsp;</td>
          <td width="115" background="images/Untitled-1.jpg" style="background-repeat:no-repeat">&nbsp;&nbsp;&nbsp;<?php echo date('Y-m-d',$time_now);  ?></td>
        </tr>
        <tr>
          <td> <div align="left"><strong>&nbsp;&nbsp;&nbsp;&nbsp;Issued By </strong></div></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><div align="center"><strong>Date</strong></div></td>
        </tr>
      </table>
	  <?php 
			
			 }else{ ?> <div align="center"> <strong> There is no record to display </strong></div><?php } ?>
	  <p>&nbsp;</p></td>
	</tr>
	<tr>
		<td><table width="620" height="42" border="0">
          <tr><hr color="#000099">
            <td><div align="left" class="style2">
              <div align="center">Generated By NAWODAYA MIS</div>
            </div></td>
          </tr>
        </table></td>
	</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
<?php  } else { header("location:../../index.php");   }?>